package com.greejoy.score.utils;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class ScoreUtils {

    public static Double roundDoubleValue(Double value, int scale){
        return new BigDecimal(String.valueOf(value)).setScale(scale, RoundingMode.HALF_UP).doubleValue();
    }

    public static String roundDoubleValueStr(Double value, int scale){
        return new BigDecimal(String.valueOf(value)).setScale(scale, RoundingMode.HALF_UP).toString();
    }

}
